{
    class SettleView extends ui.Settle.SettleViewUI{
        constructor(){
            super();

            this.data = null;

            this.initComponents();
        }

        initComponents(){
            this.btnComfirm.on(Laya.Event.CLICK, this, function () {
                // Laya.loader.load(ASSETS.HALL, Laya.Handler.create(this, function () {
                //     Sail.director.runScene(new Scene.Hall);
                // }));
                Laya.loader.load(ASSETS.MATCH, Laya.Handler.create(this, function () {
                    Sail.director.runScene(new Scene.Match("settle", this.data));
                }));
            });
            this.list_blue.renderHandler = new Laya.Handler(this, this.updateItem);
            this.list_red.renderHandler = new Laya.Handler(this, this.updateItem);
        }

        init(data){
            // this.resultWin.visible = false;
            // this.resultLoss.visible = false;
            this.data = data;

            if(data.score[0] > data.score[1]){
                this.resultWin.visible = true;
            }else if(data.score[0] < data.score[1]){
                this.resultLoss.visible = true
            }else{
                this.resultDraw.visible = true;
            }

            this.scoreBlue.text = data.score[0];
            this.scoreRed.text = data.score[1];
            this.list_blue.array = data.team[0];
            this.list_red.array = data.team[1];
        }

        updateItem(cell, index){
            if(index % 2 == 1){
                cell.bg.visible = true;
            }
            if(!cell.mediator){
                cell.mediator = new ListRender(cell);
            }
            cell.mediator.setData(cell.dataSource);
        }
    }

    Sail.class(SettleView, "Com.Settle.View");

    class ListRender{
        constructor(skin){
            this._skin = skin;
            this._skin.btn_addFriend.on(Laya.Event.CLICK, this, this.addFriend);
        }

        setData(data){
            this.uid = data.uid;
            this._skin.lb_name.text = data.ue;
            this._skin.lb_score.text = data.sc;
            this._skin.lb_kill.text = data.ki;
            this._skin.lb_death.text = data.di;
            this._skin.avatar.skin = `res/role_icon/icon_${data.icon}.png`;
            if(this.uid == GM.user_id){
                this._skin.btn_addFriend.visible = false;
            }
        }

        addFriend(){
            if(this.uid){
                this._skin.btn_addFriend.visible = false;
                console.log('添加好友');
            }
        }
    }
}